package com.dingshang.dsapp.controller;

import com.dingshang.dsapp.dto.ResponseDTO;
import com.dingshang.dsapp.service.BoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class appController extends BaseController {

    @Autowired
    private BoService boService;

    @RequestMapping("/xiandaifengge")
    @ResponseBody
    public ResponseDTO xiandaifengge(int page) {
        return ResponseDTO.success(boService.zhuangshianli(page, "0"));
    }

    @RequestMapping("/xinzhongshifengge")
    @ResponseBody
    public ResponseDTO xinzhongshifengge(int page) {
        return ResponseDTO.success(boService.zhuangshianli(page, "1"));
    }

    @RequestMapping("/meishifengge")
    @ResponseBody
    public ResponseDTO meishifengge(int page) {
        return ResponseDTO.success(boService.zhuangshianli(page, "2"));
    }

    @RequestMapping("/oushifengge")
    @ResponseBody
    public ResponseDTO oushifengge(int page) {
        return ResponseDTO.success(boService.zhuangshianli(page, "3"));
    }

    @RequestMapping("/fuwu")
    @ResponseBody
    public ResponseDTO fuwu(String serverStyle) {
        return ResponseDTO.success(boService.getFuwu(serverStyle));
    }

    @RequestMapping("/shejishi")
    @ResponseBody
    public ResponseDTO shejishi(String sjStyle, int page) {
        return ResponseDTO.success(boService.listAppShejishi(sjStyle, page));
    }

    @RequestMapping("/about")
    @ResponseBody
    public ResponseDTO about(String aboutStyle) {
        return ResponseDTO.success(boService.getAbout(aboutStyle));
    }

    @RequestMapping("/loadzxData/{zxStyle}")
    @ResponseBody
    public ResponseDTO loadzxData(@PathVariable String zxStyle, int page) {
        return ResponseDTO.success(boService.zhuangshianli(page, zxStyle));
    }

}
